{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票系统</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #5e72e4;
            --primary-dark: #3a4ab1;
            --secondary: #11cdef;
            --success: #2dce89;
            --danger: #f5365c;
            --warning: #fb6340;
            --dark: #32325d;
            --light: #f8f9fe;
            --gray: #8898aa;
            --gray-light: #e9ecef;
            --border-radius: 0.375rem;
            --box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
            --transition: all 0.15s ease;
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
            min-height: 100vh;
            padding: 0;
            position: relative;
        }
        
        /* 背景装饰元素 */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 300px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            z-index: -1;
            clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 2rem 1.5rem;
            animation: fadeIn 0.6s ease-out;
        }
        
        .header {
            text-align: center;
            margin-bottom: 3rem;
            color: white;
            position: relative;
            padding-top: 1rem;
        }
        
        .header h1 {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .header p {
            font-size: 1.1rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
        }
        
        .poll-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 2rem;
            margin-bottom: 2.5rem;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            border: none;
        }
        
        .poll-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 4px;
            height: 100%;
            background: linear-gradient(to bottom, var(--primary), var(--secondary));
            transition: var(--transition);
        }
        
        .poll-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 18px 40px rgba(50, 50, 93, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
        }
        
        .poll-card:hover::before {
            width: 6px;
        }
        
        .poll-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .poll-item {
            padding: 1.25rem 0;
            border-bottom: 1px solid var(--gray-light);
            transition: var(--transition);
            position: relative;
        }
        
        .poll-item:last-child {
            border-bottom: none;
        }
        
        .poll-item:hover {
            background-color: rgba(94, 114, 228, 0.03);
        }
        
        .poll-link {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: var(--dark);
            font-size: 1.15rem;
            font-weight: 500;
            transition: var(--transition);
            padding-left: 1.75rem;
            position: relative;
        }
        
        .poll-link:hover {
            color: var(--primary);
        }
        
        .poll-link::before {
            content: '\f054';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 0;
            color: var(--primary);
            font-size: 0.8rem;
            transition: var(--transition);
        }
        
        .poll-link:hover::before {
            transform: translateX(5px);
        }
        
        .poll-date {
            display: block;
            font-size: 0.85rem;
            color: var(--gray);
            margin-top: 0.25rem;
            font-weight: 400;
        }
        
        .no-polls {
            text-align: center;
            padding: 2rem;
            color: var(--gray);
        }
        
        .no-polls i {
            font-size: 2rem;
            margin-bottom: 1rem;
            color: var(--gray-light);
        }
        
        .action-panel {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin: 3rem 0;
        }
        
        .action-button {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            background: white;
            color: var(--dark);
            text-decoration: none;
            padding: 1.25rem 1.5rem;
            border-radius: var(--border-radius);
            font-weight: 500;
            transition: var(--transition);
            box-shadow: var(--box-shadow);
            border: none;
            cursor: pointer;
            text-align: center;
        }
        
        .action-button i {
            font-size: 1.2rem;
        }
        
        .action-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 18px 35px rgba(50, 50, 93, 0.1), 0 8px 15px rgba(0, 0, 0, 0.07);
            color: var(--dark);
        }
        
        .admin-button {
            background: var(--dark);
            color: white;
        }
        
        .admin-button:hover {
            background: #27274f;
            color: white;
        }
        
        .create-button {
            background: var(--success);
            color: white;
        }
        
        .create-button:hover {
            background: #28b67b;
            color: white;
        }
        
        .stats-button {
            background: var(--secondary);
            color: white;
        }
        
        .stats-button:hover {
            background: #0da5c2;
            color: white;
        }
        
        .footer {
            text-align: center;
            margin-top: 4rem;
            color: var(--gray);
            font-size: 0.9rem;
            padding: 1.5rem 0;
            border-top: 1px solid var(--gray-light);
        }
        
        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        
        .pulse {
            animation: pulse 2s infinite;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 1.5rem 1rem;
            }
            
            .header h1 {
                font-size: 2rem;
            }
            
            .poll-card {
                padding: 1.5rem;
            }
            
            .action-panel {
                grid-template-columns: 1fr;
            }
        }
        
        @media (max-width: 480px) {
            body::before {
                height: 250px;
            }
            
            .header h1 {
                font-size: 1.8rem;
            }
            
            .poll-link {
                font-size: 1rem;
                padding-left: 1.5rem;
            }
            
            .action-button {
                padding: 1rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>参与社区投票</h1>
            <p>表达您的观点，参与社区决策</p>
        </div>
        
        <div class="poll-card">
            {% if latest_question_list %}
                <ul class="poll-list">
                    {% for question in latest_question_list %}
                    <li class="poll-item">
                        <a href="{% url 'polls:detail' question.id %}" class="poll-link">
                            {{ question.question_text }}
                            <span class="poll-date">发布于 2023-06-15</span>
                        </a>
                    </li>
                    {% endfor %}
                </ul>
            {% else %}
                <div class="no-polls">
                    <i class="far fa-folder-open"></i>
                    <p>当前没有可用的投票项目</p>
                </div>
            {% endif %}
        </div>
        
        <div class="action-panel">
            <a href="/admin/" class="action-button admin-button">
                <i class="fas fa-cog"></i> 管理后台
            </a>
            <a href="/admin/polls/question/add/" class="action-button create-button pulse">
                <i class="fas fa-plus"></i> 创建投票
            </a>
            <a href="#" class="action-button stats-button">
                <i class="fas fa-chart-bar"></i> 投票统计
            </a>
        </div>
        
        <div class="footer">
            <p>© 2025 社区投票系统 | 版本 2.1.0</p>
        </div>
    </div>
</body>
</html>